local sk__shanjia = fk.CreateSkill {

  name = "sk__shanjia",

  tags = { Skill.Compulsory, },

}



sk__shanjia:addEffect(fk.CardUsing, {
  name = "sk__shanjia",
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(sk__shanjia.name) then
      if data.card.trueName == "slash" then
        return #player:getEquipments(Card.SubtypeOffensiveRide) == 0
      elseif data.card:isCommonTrick() and not table.contains({"iron_chain", "collateral", "nullification"}, data.card.trueName) then
        return #player:getEquipments(Card.SubtypeDefensiveRide) == 0
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    data.additionalEffect = (data.additionalEffect or 0) + 1
  end,
})

sk__shanjia:addEffect("distance", {
  name = "#sk__shanjia_distance",
  --sk__shanjia,
  correct_func = function(self, from, to)
    if from:hasSkill(sk__shanjia.name) and #from:getEquipments(Card.SubtypeOffensiveRide) == 0 then
      return -2
    end
    if to:hasSkill(sk__shanjia.name) and #to:getEquipments(Card.SubtypeDefensiveRide) == 0 then
      return 2
    end
    return 0
  end,
})

return sk__shanjia